<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改任务设置')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-tasksetting-edit" th:object="${whTasksetting}">
            <input id="id" name="id" th:field="*{id}" type="hidden">

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="点赞任务最少发布数量">点赞 最小发布量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="greatMinnum" name="greatMinnum" th:field="*{greatMinnum}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="点赞任务奖励积分">点赞 奖励能量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="greatReward" name="greatReward" th:field="*{greatReward}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="添加点赞任务时，如果置顶需要消耗的积分">点赞置顶 消耗能量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="greatSpeed" name="greatSpeed" th:field="*{greatSpeed}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="单个点赞任务加速的话需要消耗的积分">点赞加速 单个消耗能量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="greatSpeedone" name="greatSpeedone" th:field="*{greatSpeedone}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-xs-2 control-label is-required" title="发布点赞任务需要消耗的积分">点赞 消耗能量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-xs-10">
                            <input id="greatConsume" name="greatConsume" th:field="*{greatConsume}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>
            <hr style="border-top:2px solid #605ca8">
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="评论任务最少发布数量">评论 最小发布量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="commentMinnum" name="commentMinnum" th:field="*{commentMinnum}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="评论任务奖励积分">评论 奖励能量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="commentReward" name="commentReward" th:field="*{commentReward}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="添加评论任务时，如果置顶需要消耗的积分">评论置顶 消耗能量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="commentSpeed" name="commentSpeed" th:field="*{commentSpeed}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="单个评论任务加速的话需要消耗的积分">评论加速 单个消耗能量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="commentSpeedone" name="commentSpeedone" th:field="*{commentSpeedone}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-xs-2 control-label is-required" title="发布评论任务需要消耗的积分">评论 消耗能量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-xs-10">
                            <input id="commentConsume" name="commentConsume" th:field="*{commentConsume}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>
            <hr style="border-top:2px solid #605ca8">
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="关注任务最少发布数量">关注 最小发布量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="attentionMinnum" name="attentionMinnum" th:field="*{attentionMinnum}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="关注任务奖励积分">关注 奖励能量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="attentionReward" name="attentionReward" th:field="*{attentionReward}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="添加关注任务时，如果置顶需要消耗的积分">关注置顶 消耗能量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="attentionSpeed" name="attentionSpeed" th:field="*{attentionSpeed}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="单个关注任务加速的话需要消耗的积分">关注加速 单个消耗能量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="attentionSpeedone" name="attentionSpeedone" th:field="*{attentionSpeedone}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-xs-2 control-label is-required" title="发布关注任务需要消耗的积分">关注 消耗能量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-xs-10">
                            <input id="attentionConsume" name="attentionConsume" th:field="*{attentionConsume}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>
            <hr style="border-top:2px solid #605ca8">
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="发布播放量任务需要消耗的积分">播放量 单个消耗数量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="playConsume" name="playConsume" th:field="*{playConsume}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="播放量任务最少发布数量">播放量 发布最小数量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="playMinnum" name="playMinnum" th:field="*{playMinnum}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="播放量任务的api地址">播放量 api地址：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="playApi" name="playApi" th:field="*{playApi}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="播放量任务所需要的api参数">播放量 api参数：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="playPara" name="playPara" th:field="*{playPara}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="用户获取任务量">用户获取任务量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="userObtain" name="userObtain" th:field="*{userObtain}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="用户发布任务量">用户发布任务量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="userRelease" name="userRelease" th:field="*{userRelease}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="vip获取任务量">vip获取任务量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="vipObtain" name="vipObtain" th:field="*{vipObtain}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="vip发布任务量">vip发布任务量：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                            <input id="vipRelease" name="vipRelease" th:field="*{vipRelease}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-xs-2 control-label is-required" title="匹配任务的超时时间设置，以秒为单位">超时时间 单位秒：<i class="fa fa-question-circle-o"></i></label>
                        <div class="col-xs-10">
                            <input id="overtimeTime" name="overtimeTime" th:field="*{overtimeTime}" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>
            <hr style="border-top:2px solid #605ca8">
            <div class="col-md-6">
            <button style="float: right;" type="button" class="btn btn-primary" onclick="saveSetting();">提交</button>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "whzj/tasksetting";
        $("#form-tasksetting-edit").validate({
            focusCleanup: true
        });

        function saveSetting() {
            /*if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-tasksetting-edit').serialize());
            }*/
            var formData = new FormData();
            formData.append('id',$("#id").val());
            formData.append('overtimeTime',$("#overtimeTime").val());
            formData.append('greatConsume',$("#greatConsume").val());
            formData.append('greatMinnum',$("#greatMinnum").val());
            formData.append('greatReward',$("#greatReward").val());
            formData.append('greatSpeed',$("#greatSpeed").val());
            formData.append('greatSpeedone',$("#greatSpeedone").val());
            formData.append('commentConsume',$("#commentConsume").val());
            formData.append('commentMinnum',$("#commentMinnum").val());
            formData.append('commentReward',$("#commentReward").val());
            formData.append('commentSpeed',$("#commentSpeed").val());
            formData.append('commentSpeedone',$("#commentSpeedone").val());
            formData.append('attentionConsume',$("#attentionConsume").val());
            formData.append('attentionMinnum',$("#attentionMinnum").val());
            formData.append('attentionReward',$("#attentionReward").val());
            formData.append('attentionSpeed',$("#attentionSpeed").val());
            formData.append('attentionSpeedone',$("#attentionSpeedone").val());
            formData.append('playConsume',$("#playConsume").val());
            formData.append('playMinnum',$("#playMinnum").val());
            formData.append('playApi',$("#playApi").val());
            formData.append('playPara',$("#playPara").val());
            formData.append('userObtain',$("#userObtain").val());
            formData.append('userRelease',$("#userRelease").val());
            formData.append('vipObtain',$("#vipObtain").val());
            formData.append('vipRelease',$("#vipRelease").val());
            $.ajax({
                url: prefix + "/edit",
                type: 'post',
                cache: false,
                data: formData,
                processData: false,
                contentType: false,
                dataType: "json",
                success: function(result) {
                    $.operate.successCallback(result);
                }
            });
        }
    </script>
</body>
</html>